// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

enum GameMode {

    GameModeEasy = 0,
    GameModeHard
}

@ccclass
export default class Lobby extends cc.Component {

    canvas: cc.Node = null;

    static inst: Lobby = null;

    // LIFE-CYCLE CALLBACKS:

    gameMode : number = 0;

    onLoad () {

        Lobby.inst = this;

        this.gameMode = 0;

        this.canvas = cc.find('Canvas');
    }

    start () {

    }

    // 开始简单模式
    startSimpleMode() {

        cc.log("进入简单模式");

        this.gameMode = GameMode.GameModeEasy;

        cc.director.loadScene('SimpleModeScene');
    }

    // 开始困难模式
    startHardMode() {

        cc.log("进入困难模式");

        this.gameMode = GameMode.GameModeHard;

        cc.director.loadScene('HardModeScene');
    }

    // update (dt) {}
}
